package com.weigang.util;

import com.siperian.sif.message.Field;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @author whj
 * @version 1.0
 * @date 2022/5/26 15:57
 * @describe
 */
public class FieldUtil {

    public static String getFieldDateValue(Field field) {
        if (field == null) {
            return null;
        }
        Date date = field.getDateValue();
        if (date == null) {
            return null;
        } else {
            return date.toString();
        }
    }

    public static String getFieldStringValue(Field field) {
        if (field == null) {
            return null;
        }
        return field.getStringValue();
    }

    public static String getFieldBigDecimalValue(Field field){
        if (field == null) {
            return null;
        }
        BigDecimal bigDecimal = field.getBigDecimalValue();
        if (bigDecimal == null) {
            return null;
        } else {
            return bigDecimal+"";
        }
    }



}
